/****************************************************************************/
/* File: scs-keyboard.h                                                     */
/* Desc: Specification file for the input keyboard type                     */
/* Created: 2014-11-11                                                      */
/* Revised: 2014-11-15                                                      */
/* Authors: Sterling P. de Mille                                            */
/****************************************************************************/

// include once
#ifndef _SCS_KEYBOARD_H_
#define _SCS_KEYBOARD_H_

// core data types
#include "../Core/scs-types.h"

// SDL framework
#include <SDL/SDL.h>

// assert support
#include <assert.h>

using namespace std;

class SCSkeyboard {
protected:

	const static SCSint MAXKEYCODES = (SDLK_LAST + 1);

	SCSint8u* m_piCurrentState;
	SCSint8u* m_piPreviousState;

	static SCSkeyboard* m_pkSingleton;

	void Init ();
	void UpdateMappings ();

public:

	SCSkeyboard ();
	~SCSkeyboard ();

	void Update ();

	SCSint KeyCount ();

	SCSbool KeyUp (SCSint iKeyCode);
	SCSbool KeyDown (SCSint iKeyCode);
	SCSbool KeyPressed (SCSint iKeyCode);
	SCSbool KeyReleased (SCSint iKeyCode);

	static SCSkeyboard* Singleton ();
};

#endif // _SCS_KEYBOARD_H_
